<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.box2{
				width: 100px;
				height: 100px;
				background-color: red;
				position:absolute;
				left: 10px;
				top: 10px;
			}
		</style>
	</head>
	<body>
		<div class="box1">
			<div class="box3">
				<div class="box2"style="left: 10px;"></div>
			</div>
		</div>
		<script type="text/javascript">
			var box2 = document.getElementsByClassName("box2")[0];
			//offsetTop和offsetLeft
			console.log(box2.offsetLeft);
			console.log(box2.style.left);
		</script>
	</body>
</html>
